package Program;
/**
 * 小时工
 */
public class HourlyEmployee extends Employee{
    private float hourlySalary;


    private float hoursPerMonth;

    public HourlyEmployee(String name, int birthdayMonth, float hourlySalary, float hoursPerMonth) {
        super(name, birthdayMonth);
        this.hourlySalary = hourlySalary;
        this.hoursPerMonth = hoursPerMonth;
    }
//小时工的方法
    public float countSalary() {
        float salary = 0;
        if (hoursPerMonth > 160) {
            salary += (float) ((hoursPerMonth - 160) * hourlySalary * 1.5);
            salary += 160 * hourlySalary;
        } else {
            salary += hoursPerMonth * hourlySalary;
        }
        return salary;
    }

    public float getHourlySalary() {
        return hourlySalary;
    }

    public void setHourlySalary(float hourlySalary) {
        this.hourlySalary = hourlySalary;
    }

    public float getHoursPerMonth() {
        return hoursPerMonth;
    }

    public void setHoursPerMonth(float hoursPerMonth) {
        this.hoursPerMonth = hoursPerMonth;
    }
}
